<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <link rel="shortcut icon" href="/cwp/favicon.ico" type="image/x-icon" />
    <title>系统管理-设备管理</title>
    <!--引入CSS文件-->
    <link rel="stylesheet" type="text/css" href="../../../assets/css/styles/style.css" />
    <link rel="stylesheet" type="text/css" href="../../../assets/css/styles/components-css/list.css" />
    <link rel="stylesheet" type="text/css" href="../../../assets/css/styles/components-css/table.css" />
    <link rel="stylesheet" type="text/css" href="../../../assets/css/styles/components-css/paging.css" />
    <link rel="stylesheet" type="text/css" href="../../../assets/css/styles/components-css/btn.css" />
    <link rel="stylesheet" type="text/css" href="../../../assets/css/styles/components-css/taqs.css" />
    <link rel="stylesheet" type="text/css" href="../../../assets/css/styles/components-css/form.css"/>
    <link rel="stylesheet" type="text/css" href="../../../assets/lib/bootstrap-3.3.5-dist/css/bootstrapModel.css" />
    <link rel="stylesheet" type="text/css" href="../../../assets/lib/zTree/css/metroStyle/metroStyle.css"/>
    <!--表单验证样式--->
    <link rel="stylesheet" type="text/css" href="../../../assets/lib/formValidator/style/validator.css"/>
    <style type="text/css">
        .t-layout-ra .ra-left{
            padding: 0;
            width: 180px;
            margin-right: -181px;
        }
        .t-layout-ra .ra-right .ra-rightinner{
            margin-left: 181px;
        }
        .t-list-btns{margin: 0}
        #modalEquipment .modal-body{
            padding: 0;
        }
        .buildingModal .ztree {
            border: 1px solid #617775;
            background: #fff;
            overflow-y: auto;
            overflow-x: auto;
        }
        #addChildrenList li{
            width: 40%;
        }
        #addChildrenList .addChildrenListDel{
            width: 14%;
        }
        #addChildrenList li div{
            width: 50%;;
        }
    </style>
</head>
<body>

<!--头部文件 开始-->
<div id="header"></div>
<!--头部文件 结束-->


<div class="wrapper">
    <div id="left-menu"></div>
    <div class="right-container">
        <div class="right-scroll">
            <div class="t-list">
                <div class="t-list-title">
                    <h2>系统管理 > 设备管理</h2>
                </div>
                <div class="t-list-search t-columns-5">
                    <form id="frmSearch"  onsubmit="return false">
                        <ul class="t-columns-group">
                            <input type="hidden" id="buildingId" name="buildingId"/>
                            <li>
                                <label>设备类型</label>
                                <div>
                                    <select  id="searchDeviceTypeId" name="deviceTypeId"/>
                                    </select>
                                </div>
                            </li>
                            <li>
                                <label>设备编码</label>
                                <div><input id="deviceName" name="devicePositionCode"/></div>
                            </li>
                            <li>
                                <label>&nbsp;</label>
                                <div>
                                    <a class="t-btn" id="btnSearch">
                                        <i class="icon-search"></i>
                                        查询
                                    </a>
                                </div>
                            </li>
                        </ul>
                    </form>
                </div>

                <div class="t-layout-ra clearfix">
                    <div class="ra-left">
                        <div class="t-list-btns">
                            <p>建筑结构</p>
                        </div>
                        <ul id="treeOrg" class="ztree"></ul>
                    </div>
                    <div class="ra-right">
                        <div class="ra-rightinner">

                            <div class="t-list-btns">
                                <p>请求记录</p>
                                <span id="deviceTableTotal"></span>
                                <div>
                                    <a class="t-btn t-btn-blue" id="btnAddEquipment">新增</a>
                                </div>
                            </div>

                            <div class="t-list-result  clearfix">
                                <!-- 表格 -->
                                <table class="t-table" id="deviceTable">
                                    <thead>
                                    <tr>
                                        <th>设备类型</th>
                                        <th>设备名称</th>
                                        <th>设备编码</th>
                                        <th>设备位置详情</th>
                                        <th>设备状态</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>
                                    <tbody></tbody>
                                </table>
                                <div class="loading-container"></div>
                                <!-- 分页 -->
                                <div class="pagination" id="deviceTablePagination"></div>
                            </div>
                        </div>
                    </div>
                </div>



            </div>
        </div>
    </div>
</div>
<!--版权-->
<div id="copyright"> </div>

<script type="text/html" id="dataTmpl">
    {{each beans}}
    <tr>
        <td>{{$value.deviceTypeName}}</td>
        <td>{{$value.deviceNameFirst}}</td>
        <td>{{$value.devicePositionCode}}</td>
        <td>{{$value.devicePositionDescribe}}</td>
        <td>{{$value.deviceState | deviceStateFormat}}</td>
        <td>
            <a class="t-btn t-btn-sm t-btn-blue t-btn-deal btn-detail" data-id="{{$value.deviceId}}">详情</a>
            <a class="t-btn t-btn-sm t-btn-green t-btn-edit" data-id="{{$value.deviceId}}">修改</a>
        </td>
    </tr>
    {{/each}}
</script>



<!--新增模态框模态框-->
<div class="modal fade bs-example-modal-lg in" id="modalEquipment" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                <h4 class="modal-title">新增设备</h4>
            </div>
            <form id="frmMain">
                <div class="modal-body">
                    <div class="t-list">
                        <!--设备基本信息-->
                        <div class="t-list-btns">
                            <p>设备基本信息</p>
                            <input type="hidden" id="hidDeviceId" name="deviceId" value=""/>
                            <div>
                                <a class="t-btn t-btn-blue" id="addChildren" onclick="addChildren()">添加子设备</a>
                            </div>
                        </div>
                        <div class="person-setting first">
                            <div class="t-columns-2">
                                <ul class="t-columns-group ">
                                    <li>
                                        <label class="necessary">设备类型</label>
                                        <div>
                                            <select id="deviceTypeId" name="deviceTypeId">
                                                <option value="">--请选择--</option>
                                            </select>
                                        </div>
                                    </li>
                                    <li>
                                        <label class="necessary">设备编码</label>
                                        <div>
                                            <input id="devicePositionCode" name="devicePositionCode">
                                            <input type="hidden" id="oldDevicePositionCode">
                                            <input type="hidden" id="assoldDevicePositionCode">
                                        </div>
                                    </li>
                                    <li class="verify">
                                        <label></label>
                                        <div class="tipArea"><div id="deviceTypeIdTip"></div></div>
                                    </li>
                                    <li class="verify">
                                        <label></label>
                                        <div class="tipArea"><div id="devicePositionCodeTip"></div></div>
                                    </li>


                                    <li>
                                        <label class="necessary">楼栋位置信息</label>
                                        <div>
                                            <input type="text" id="buildingname" placeholder="--请选择--" readonly="" value=""/>
                                            <input type="hidden" id="hidBuildingId" name="buildingId" value=""/>
                                        </div>
                                    </li>
                                    <li>
                                        <label>设备位置详情</label>
                                        <div>
                                            <input id="devicePositionDescribe" name="devicePositionDescribe"/>
                                        </div>
                                    </li>
                                    <li class="verify">
                                        <label></label>
                                        <div class="tipArea"><div id="hidBuildingIdTip"></div></div>
                                    </li>
                                    <li class="verify">
                                        <label></label>
                                        <div class="tipArea"><div></div></div>
                                    </li>

                                    <li>
                                        <label class="necessary">供应商</label>
                                        <div>
                                            <select id="vendorList" name="vendorId">
                                                <option value="">--请选择--</option>
                                            </select>
                                        </div>
                                    </li>
                                    <li>
                                        <label>设备品牌</label>
                                        <div class="clearfix">
                                            <input name="deviceBrand" id="deviceBrand" placeholder="设备品牌" />
                                        </div>
                                    </li>
                                    <li class="verify">
                                        <label></label>
                                        <div class="tipArea"><div id="vendorListTip"></div></div>
                                    </li>
                                    <li class="verify">
                                        <label></label>
                                        <div></div>
                                    </li>

                                    <li>
                                        <label class="necessary">坐标</label>
                                        <div class="clearfix">
                                            <input class="fl" style="width: 45%;" maxlength="3" id="deviceX" name="deviceX" placeholder="X轴" />
                                            <input class="fr" style="width: 45%;" maxlength="3" id="deviceY" name="deviceY" placeholder="Y轴" />
                                        </div>
                                    </li>
                                    <li>
                                        <label class="necessary">是否可控制</label>
                                        <div class="clearfix">
                                            <label style="padding-right:3px;">
                                                <input class="t-form-check" type="radio" name="isDeviceControl" id="isDeviceControlYes" checked="" value="0">是
                                            </label>
                                            <label>
                                                <input class="t-form-check" type="radio" name="isDeviceControl"  id="isDeviceControlNo" value="1">否
                                            </label>
                                        </div>
                                    </li>
                                    <li class="verify">
                                        <label></label>
                                        <div class="tipArea">
                                            <div id="deviceCoordinateTip"></div>
                                        </div>
                                    </li>
                                    <li class="verify">
                                        <label></label>
                                        <div><div></div></div>
                                    </li>



                                    <li>
                                        <label>接口面板地址</label>
                                        <div>
                                            <input type="text" id="interfaceaddr" name="interfaceaddr" value="" maxlength="2" placeholder="数字0-31"/>
                                        </div>
                                    </li>
                                    <li>
                                        <label class="">设备IP</label>
                                        <div>
                                            <input type="text" id="controllerip" name="controllerip"/>
                                        </div>
                                    </li>
                                    <li class="verify">
                                        <label></label>
                                        <div class="tipArea"></div>
                                    </li>
                                    <li class="verify">
                                        <label></label>
                                        <div class="tipArea"><div id="controlleripTip"></div></div>
                                    </li>
                                    <li>
                                        <label class="necessary">是否有子设备</label>
                                        <div class="clearfix">
                                            <label style="padding-right:3px;">
                                                <input class="t-form-check" type="radio" name="isDeviceInfo" id="yesDevice" checked="" value="0">是
                                            </label>
                                            <label>
                                                <input class="t-form-check" type="radio" name="isDeviceInfo" id="delDevice" value="1">否
                                            </label>
                                        </div>
                                    </li>
                                    <li>
                                        <label class="">代理端口</label>
                                        <div>
                                            <input type="text" id="devicePort" name="devicePort"/>
                                        </div>
                                    </li>

                                    <li class="verify">
                                    </li>
                                    <li class="verify">
                                        <label></label>
                                        <div class="tipArea"><div id="devicePortTip"></div></div>
                                    </li>


                                    <li class="cameraType">
                                        <label class="necessary">镜头id</label>
                                        <div>
                                            <input type="text" id="videoId" name="videoId"/>
                                        </div>
                                    </li>
                                    <li class="cameraType">
                                        <label class="necessary">控制ip</label>
                                        <div>
                                            <input type="text" id="videoIp" name="videoIP"/>
                                        </div>
                                    </li>
                                    <li class="verify cameraType">
                                        <label></label>
                                        <div class="tipArea"><div id="videoIdTip"></div></div>
                                    </li>
                                    <li class="verify cameraType">
                                        <label></label>
                                        <div class="tipArea"><div id="videoIpTip"></div></div>
                                    </li>

                                    <li class="cameraType">
                                        <label>摄像头类型</label>
                                        <div>
                                            <select name="type" id="typeValue">
                                                <option value="">--请选择--</option>
                                                <option value="1">彩色半球网络摄像机720P</option>
                                                <option value="2">彩色枪式网络摄像机720P</option>
                                                <option value="3">彩色电梯专用摄像机D1</option>
                                            </select>
                                        </div>
                                    </li>
                                    <li></li>


                                    <li class="verify cameraType">
                                        <label></label>
                                        <div class="tipArea"><div id="typeTip"></div></div>
                                    </li>
                                    <li class="verify cameraType"></li>
                                </ul>

                            </div>
                            <input type="hidden" id="childrenDevice" name="childrenDevice" value="doorControl"/>
                            <div class="person-setting" id="addChildrenList">

                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" id="btnSave">保存</button>
                </div>
            </form>
        </div>
    </div>
</div>



<!--建筑树模态框-->
<div id="buildingModal" class="buildingModal" style="display:none; position: absolute;z-index: 9999;border: 1px solid #617775;">
    <ul id="treeOrgModal" class="ztree" style="margin-top:0; width:128px; height: 200px;"></ul>
</div>
<!--提示模态框-->
<div class="modal fade bs-example-modal-sm" id="myTip" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-body" style="text-align:center;font-size:14px;">
                <i id="icon-tip" style="margin-right:6px;"></i>
                <span class="tip-info"></span>
            </div>
        </div>
    </div>
</div>

<!--提示子设备模态框-->
<div class="modal fade bs-example-modal-sm" id="modalDelDept" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
    <div class="modal-dialog modal-sm" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">是否清除子设备?</h4>
            </div>
            <div class="modal-body">
                <div class="t-list">
                    <div id="delDeptName" class="title" style="font-weight: bold;">
                    </div>
                    <div class="content mt-10" style="line-height: 24px">
                        选择无子设备后，将删除原有的所有子设备。是否确定删除？
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal" id="delBack">取消</button>
                <button type="button" class="btn btn-primary"  id="btnDeleteDept">确定</button>
            </div>
        </div>
    </div>
</div>

<!--jQuery库脚本-->
<!--非IE8浏览器-->
<!--[if !(IE 8)]><!--><script type="text/javascript" src="../../../assets/lib/jquery/jquery.min.js"></script><!--<![endif]-->
<!--IE8浏览器-->
<!--[if IE 8]><script type="text/javascript" src="../../../assets/lib/jquery/jquery-ie8.min.js"></script><![endif]-->
<script type="text/javascript" src="../../../assets/lib/jQuery-slimScroll-1.3.8/jquery.slimscroll.min.js"></script>
<script charset="utf-8" src="../../../assets/common/loadHeaderAndCopyright.js"></script>
<!--树形节点-->
<script charset="utf-8" src="../../../assets/lib/zTree/js/jquery.ztree.core.js"></script>
<script charset="utf-8" src="../../../assets/lib/zTree/js/jquery.ztree.excheck.js"></script>
<script charset="utf-8" src="../../../assets/lib/zTree/js/jquery.ztree.exedit.js"></script>
<!--表单验证-->
<script src="../../../assets/lib/formValidator/formValidator.js"></script>
<script src="../../../assets/lib/formValidator/formValidatorRegex.js"></script>
<!--模态框-->
<script charset="utf-8" src="../../../assets/lib/bootstrap-3.3.5-dist/js/bootstrap.js"></script>
<script charset="utf-8" src="../../../assets/common/centerModal.js"></script>
<script charset="utf-8" src="../../../assets/lib/tipModal/js/tipModal.js"></script>
<!--分页脚本-->
<script charset="utf-8" src="../../../assets/lib/pagination/1.2.1/jquery.pagination.js"></script>
<script charset="utf-8" src="../../../assets/lib/artTemplate/template.js"></script>
<script charset="utf-8" src="../../../assets/common/loaderTableTmpl.js"></script>
<script charset="utf-8" src="../../../assets/common/ajaxPoster.js"></script>
<script charset="utf-8" src="../../../js/systemManagement/equipmentManagement/equipmentManagement.js"></script>
<script charset="utf-8" src="../../../js/systemManagement/equipmentManagement/equipmentModal.js"></script>
</body>
</html>